<template>
	<view class="content">
		<view class="content-top">
			<view class="top-title">我要贷款</view>
			<!-- <view class="top-title-two">
				<view class="title-characters">“码上就业” 小程序上线啦！</view>
			</view> -->
			<view class="characters-script">
				<view class="characters">
					<view class="title" style="text-align: center;">
						创业担保贷款申请政策及条件
					</view>
					<text decode="true" style="text-indent:2em;">
						一、为充分发挥创业担保贷款扶持创业、带动
						就业、促进发展的积极作⽤，进⼀步减轻创业者和
						⽤⼈单位负担，推进我区⼤众创业、万众创新，扩
						⼤有效就业。根据关于印发《普惠⾦融发展专项资
						⾦管理办法》的通知（财⾦〔2023〕75号）⽂件
						的要求，制定本办法。
					</text>
					<view style="text-indent:2em;">
						二、 创业担保贷款，是指以具备规定条件的
						创业者个⼈或⼩微企业为借款⼈，由创业担保贷款
						担保基⾦（以下简称担保基⾦）提供担保、经办⾦
						融机构发放、财政贴息的贷款业务。
					</view>
					<view style="text-indent:2em;">
						三、创业担保贷款借款⼈为创业者个⼈的，须
						同时具备下列条件：
					</view>
					<view style="text-indent:2em;">
						（⼀）进⾏⼯商登记注册的个体⼯商⼾经营
						者、私营企业业主或合伙⼈。虽未进⾏⼯商登记注
						册但已被认定为灵活就业⼈员并在⽹络平台实名注
						册、稳定经营且信誉良好、带动就业能⼒强，创业
						项⽬好的⽹络商⼾创业者；
					</view>
					<view style="text-indent:2em;">
						（⼆）⼯商登记注册或在⽹络平台实名注册之
						前，为登记失业⼈员或实际处于⽆业状态的⾼校毕
						业⽣（含留学回国学⽣）、复员转业退役军⼈、就
						业困难⼈员（含残疾⼈）、刑释解教⼈员、化解过
						剩产能所涉及的企业分流⼈员、建档⽴卡的贫困⼾
						成员，以及⼤学⽣村官、返乡创业农⺠⼯、农村⾃
						主创业农⺠。
					</view>
				</view>
			</view>
		</view>
		<view style="height: 160rpx;">
			<view class="btn" @click="navigate('/page_other/business_loan/business_loan')">贷款申请</view>
		</view>

	</view>
</template>

<script>
	// import {
	// 	getSalaryData
	// } from '@/util/util.js'
	// import {
	// 	submitIntention,
	// 	getIntention
	// } from '@/api/resume.js'
	// import {
	// 	validate
	// } from '@/util/validate.js'
	export default {
		data() {
			return {
				id: null,
				form: {
					id: 0,
					salaryMin: 3000,
					salaryMax: 4000,
					post: null,
					// regArea: null,
					recruitType: 1,
					industryType: 1,
					postNames: ''
				},
				industry: [],
				rules: {
					post: {
						name: '期望职位',
						required: true
					},
					// regArea: {
					// 	name: '期望地点',
					// 	required: true
					// }
				},
				//地点选择
				region: [],
				//薪资选择
				salary: [],
				salaryIndexArr: [0, 0],
				//全职兼职选择
				type: [{
					id: 1,
					value: '全职'
				}, {
					id: 2,
					value: '兼职'
				}],
				typeIndex: 0,
				regionArr: [],
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			salaryChange(e) {
				this.form.salaryMin = this.salary[0][e.detail.value[0]]
				this.form.salaryMax = this.salary[1][e.detail.value[1]]
			},
			salaryColChange(e) {
				if (e.detail.column == 0) {
					this.getSalary(e.detail.value + 1)
				}
			},
			getSalary(select) {
				this.salary = getSalaryData(select);
			},
			bindType(e) {
				this.form.recruitType = e.detail.value * 1 + 1
			},
			bindIndustryType(e) {
				this.form.industryType = e.detail.value * 1 + 1
			},
			bindRegion(e) {
				this.regionArr = e.detail.value.map((item) => {
					return item.value
				})
			},
			chooseJobCategory() {
				uni.navigateTo({
					url: '/page_other/job_category/index?max=1'
				})
			},
			handleSave() {
				if (validate(this.form, this.rules)) {
					uni.navigateTo({
						url: '/page_other/job_hunting/job_list/index?jobType=' + this.form.post
					})
				}
			},
			getDetail(id) {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				getIntention({
					id
				}).then((res) => {
					let regionArr = res.regArea.split(',');
					res.regArea = regionArr[2]
					this.regionArr = regionArr;
					this.salaryIndexArr = [res.salaryMin / 1000 - 1, (res.salaryMax - res.salaryMin) / 1000 - 1]
					this.getSalary(res.salaryMin / 1000);
					this.form = res
				}).catch(() => {
					this.showToast('加载失败', () => {
						uni.navigateBack()
					})
				})
			}

		},
		onShow(e) {
			this.region = this.globalConfig.area
			uni.$on('getJobCategory', (e) => {
				this.form.post = e[0].id
				this.form.postNames = e[0].jobTitle;

			})
		},
		onLoad(e) {
			if (e.id) {
				this.getDetail(e.id)
			} else {
				this.getSalary(1);
			}
		}

	}
</script>

<style lang="scss">
	.content {
		background: url('https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/dunhuang/fast_background2.png');
		background-repeat: round;
		
		.content-top {
			background: url('https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/dunhuang/fast_background1.png');
			background-repeat: no-repeat;
			background-size: 100% 45%;
			height: 100%;
			padding-top: 110rpx;
			
			.top-title {
				color: #fff;
				display: flex;
				justify-content: center;
				text-align: center;
				padding-bottom: 110rpx;
			}

			.characters-script {
				background: url('https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/home/jq-erq/fast_content.png');
				background-repeat: no-repeat;
				background-size: 100% 100%;
				width: 90%;
				margin: 0 40rpx 60rpx 40rpx;

				.characters {
					padding: 170rpx 20rpx 40rpx 20rpx;
					font-size: 15px;
					text-indent: 2em;
					line-height: 2em;

				}
			}

		}

		.content-bottom {

			.content-form {
				background-color: #fff;
				width: 90%;
				margin: 60rpx 40rpx 60rpx 40rpx;
				border-radius: 12rpx;

				.form-characters {

					padding: 60rpx 35rpx 60rpx 35rpx;

					.item-title {
						color: #0277FD;
						font-size: 36rpx;
					}

					.form-item {
						display: flex;
						flex-direction: column;
						border-bottom: 1px solid #efefef;
						padding-top: 30rpx;

						.form-label {
							font-size: 28rpx;
							color: #999;
						}

						.form-content {
							display: flex;
							flex-direction: row;
							align-items: center;

							.form-ctrl {
								height: 100rpx;
								line-height: 100rpx;
								flex-grow: 1;
							}

							.arrow {
								flex-grow: 0;
								color: #999;
								font-size: 24rpx;
							}
						}

					}

				}

			}

		}

		.btn {
			width: 350rpx;
			height: 80rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			background: #FFB200;
			color: #000;
			font-size: 28rpx;
			border-radius: 40rpx;
			margin: 0 auto;
			margin-top: 30rpx;
		}

	}
</style>